1. Field of the Invention
The present invention relates to image processing method and apparatus for performing color correction according to a histogram of an original image, and to a recording medium in which a program to realize the image processing method has been stored.
2. Related Background Art
As a result of improvement of personal computer performance in recent years, it becomes possible to easily handle even a large-capacity file at high speed. In other words, new users come to handle a photographic natural image to which a large-capacity memory is generally necessary. In addition, since input equipments such as a digital camera, a scanner and the like have been popularized, it becomes possible to digitize various images. A photographic image includes various kinds of images such as a high-quality image taken by a professional photographer, a poor image (i.e., image of which quality is not so high), and the like. In this case, it should be noted that the poor image includes an overexposed image, an underexposed image, a color-fogged image entirely having tint, or the like. Generally, it is thought that the poor image is formed under such a poor photographing condition as a light quantity necessary when the image is taken is inadequate, and the image is taken by using only a fluorescent lamp. Further, it is thought that the poor image is also formed when, e.g., image deterioration is caused in a digitizing process by noise and characteristic of the digital camera. After the poor image is subjected to the digitizing process and then fetched by the personal computer or the like, it is possible to improve the quality of this image by performing necessary correction.
As methods to do so, various correction methods have been proposed. In one of the methods, highlight and shadow points are first determined, and the necessary correction is performed based on the determined points. To perform this method, a histogram of luminance Y of the target image is formed. In this case, the luminance Y is obtained from red (R), green (G) and blue (B) input signal values (each having eight bits) by using a following expression.
Y=axc3x97R+bxc3x97G+cxc3x97B
(where a+b+c=1)
According to an NTSC (National Television System Committee) transmission system, the values of the above constants a, b and c are given as 0.3, 0.59 and 0.11, respectively.
The poor image (e.g., underexposed image) generally has such a luminance histogram as shown in FIG. 17. This histogram shows that points to be inherently represented as white points are not actually represented as the white points. Thus, in order to prevent such inconvenience, the luminance at higher several percent of the entire pixels is determined as a highlight point (YHL) and the luminance at lower several percent of the pixels is determined as a shadow point (YSD), as shown in FIG. 17.
Then, an image correction process according to the determined highlight and shadow points is performed to improve the image quality of the underexposed or overexposed image. Such an image quality improvement method has been proposed by the present applicant.
By forming the histogram of the luminance Y of the target image to be corrected and then determining the highlight and shadow points in the histogram for image conversion, it is possible to perform contrast adjustment to improve the quality of the underexposed or overexposed image. Also, it is possible to improve the quality of the color-fogged image.
FIG. 9 shows an example of an image in which an yellow flower image of full image size is taken. The luminance histogram of this example is shown in FIG. 10. That is, the luminance Y of yellow (R=G=255, B=0) has the large value 227. For this reason, as shown in FIG. 9, if the photographic image includes the numerous yellow portions, the highlight point YHL is forcibly determined at the yellow portion. Thus, there is some fear that the inherently yellow flower is represented as a white flower.
FIG. 11 shows an image in which a white edge is added to the frame of a photograph. Generally, such the image has such a histogram as shown in FIG. 12. That is, since the white edge is included in the image, the pixel is detected at the luminance Y (=255). For this reason, even if this image is poor, an appropriate highlight point can not be determined when the image correction is to be performed, whereby it is impossible to improve the image quality. Similarly, if a black edge is added, since an appropriate shadow point can not be determined, whereby it is impossible to improve the image quality.
FIG. 15 shows an image in which red characters are added to a photograph. In this image, since the character color is red, determination of highlight and shadow points is not so influenced by the characters. However, since all the pixels concerning the original image are converted, photographic portions are improved but the red of the characters included in the photographic portion is changed from its initial state (i.e., original red). Therefore, if a mark (e.g., company logo) of which tint is considered to have an importance is included in the image, a serious problem occurs.
Further, if a graphics image in which photographic portions are extremely small or no photographic portion is included is corrected in the same manner as for the photograph, there is some fear that its image quality is deteriorated.
The present invention has been made to solve the above conventional problems, and an object thereof is to enable satisfactory color processing according to a characteristic of an original image.
An object of the first invention is to be able to set a satisfactory color processing condition even if an original image includes a high-luminance color having a tint included in the original image.
In order to achieve the above object, there is provided an image processing method comprising the steps of:
inputting image data representing an original image;
judging whether or not the value of a saturation component of the image data is larger than a predetermined value;
forming, if the value of the saturation component of the image data is larger than the predetermined value, a histogram of the original image except the image data;
setting a color processing condition on the basis of the formed histogram; and
performing color processing to the original image on the basis of the set color processing condition.
An object of the second invention is to be able to set a color processing condition suitable for an original image even if a portion such as an edge of the original image other than an image portion is included in the original image.
In order to achieve the above object, there is provided an image processing method comprising the steps of:
inputting image data representing an original image;
judging whether or not the same image data are successive in a predetermined number;
forming, if the same image data are successive in the predetermined number, a histogram of the original image except the image data;
setting a color processing condition on the basis of the formed histogram; and
performing color processing to the original image on the basis of the set color processing condition.
An object of the third invention is to faithfully reproduce a specific color included in an original and also satisfactorily reproduce an image portion of the original image.
In order to achieve the above object, there is provided an image processing method comprising the steps of:
inputting a user""s instruction representing an arbitrary color;
forming a histogram representing a color other than the color according to the user""s instruction, on the basis of image data included in an original image;
setting a color processing condition on the basis of the formed histogram; and
performing color processing based on the set color processing condition, to the original image.
An object of the fourth invention is not to perform, to a graphic image, color processing according to color distribution of an original image.
In order to achieve the above object, there is provided an image processing method for inputting image data representing an original image, and performing color processing according to color distribution of the original image, said method comprising the steps of:
judging whether or not the same image data are successive in a predetermined number; and
controlling the color processing in accordance with the number of pixels of the image data being successive in the predetermined number in the original image.
Other objects, advantages and salient features of the present invention will become apparent from the detailed description which, takes in conjunction with the annexed drawings, disclose the preferred embodiments of the present invention.